import request from '@/utils/request'

// 获取员工数据
export const getEmployeeListAPI = data => {
  return request({
    url: '/sys/user',
    method: 'GET',
    params: data
  })
}

// 删除员工
export const delEmployeeAPI = id => {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

// 添加员工
export const addEmployeeAPI = data => {
  return request({
    method: 'POST',
    url: '/sys/user',
    data
  })
}

// 导入员工
export const importEmployeeAPI = data => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

// 获取角色列表
export const getRolesAPI = params => {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

// 角色分配权限
export const assignRolesAPI = data => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
